# Copyright (c) 2008, Eamonn Faherty
# This is licensed under the MIT licence.

class CheckPackage:
	"""Container for package checkstyle tests"""
	def __init__(self):
		pass

	def checkAvoidStarImport(self, package):
		"""Check for AvoidStarImport"""
		for stmt in package.imports:
			if stmt.find("*") != -1:
				return -1
		
		return 0

class CheckMethod:
	"""Container for method checkstyle tests"""
	def __init__(self):
		pass

	def checkParameterNumber(self, mtd):
		"""Check for ParameterNumber"""
		if (len(mtd.arguments) > 7):
			return -1
		else:
			return 0
	
class CheckInterface:
	"""Container for interface checkstyle tests"""
	def __init__(self):
		pass

	def checkInterfaceIsType(self, interface):
		"""Check that interface is a type"""
		if len(interface.methods)  == 0: 
			return -1
		else :
			return 0